package com.tony.study.designMode.DM5_建造者模式.DM5;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: CakeMaker
 * @Auther: 皮蛋布丁
 * @Date: 2021/11/01/21:22
 * @Description: 蛋糕师（根据builder定义的制作工序制作蛋糕）
 */
public class CakeMaker implements CakeBuilder{
    /**
     * 蛋糕师名字
     */
    private String name;
    /**
     * 需要制作的蛋糕(不管最终去向)
     */
    private Cake cake = new Cake();

    public CakeMaker() {
    }

    public CakeMaker(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCake(Cake cake) {
        this.cake = cake;
    }

    @Override
    public void knead() {
        cake.addProcess("揉面");
    }

    @Override
    public void ferment() {
        cake.addProcess("发酵");
    }

    @Override
    public void bake(int minutes) {
        cake.addProcess("烘烤" + minutes + "分钟");
    }

    @Override
    public Cake getCake() {
        return this.cake;
    }
}
